package com.API;

public class Worker {
    private String name ;
    private int year ;

    public Worker(String name, int year) {
        this.name = name;
        this.year = year;
    }

    public Worker() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }
    public void show(){
        System.out.println("该工人具体属性如下");
        System.out.println("姓名："+name);
        System.out.println("年龄："+year);

    }

}
